package com.rd.student.wulian.wanggaobo.day0728.practice01;
public class FizzBuzz {
    public static String fizzBuzz(int num) {

        if (num % 3 == 0 && num % 5 == 0) {
            return "FizzBuzz";
        }

        else if (num % 3 == 0) {
            return "Fizz";
        }

        else if (num % 5 == 0) {
            return "Buzz";
        }

        else {
            return String.valueOf(num);
        }
    }

    public static void main(String[] args) {
        int num1 = 3;
        int num2 = 5;
        int num3 = 15;
        int num4 = 4;
        String result1 = fizzBuzz(num1);
        String result2= fizzBuzz(num2);
        String result3 = fizzBuzz(num3);
        String result4 = fizzBuzz(num4);
        System.out.println(result1);
        System.out.println(result2);
        System.out.println(result3);
        System.out.println(result4);
    }
}